package com.spzx.user.controller;

import com.spzx.common.core.context.SecurityContextHolder;
import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.common.security.annotation.RequiresLogin;
import com.spzx.user.domain.UserAddress;
import com.spzx.user.mapper.RegionMapper;
import com.spzx.user.service.IUserAddressService;
import com.spzx.user.service.RegionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.endpoint.SecurityContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.spzx.common.core.web.domain.AjaxResult.success;

/**
 * @ClassName RegionController
 * @Description TODO
 * @Author 东北彭于晏
 * @Date 2024/10/21  20:37
 * @Version 1.0
 **/
@Tag(name = "地区信息接口管理")
@RestController
@RequestMapping("/region")
public class RegionController {


    @Autowired
    private RegionService regionService;


    @GetMapping(value = "/treeSelect/{parentCode}")
    public AjaxResult treeSelect(@PathVariable String parentCode) {
        return success(regionService.treeSelect(parentCode));
    }

}
